package cn.ywang.mybatis.old;

import java.lang.reflect.Proxy;
import java.util.ResourceBundle;

/**
 * Mybatis配置类
 *
 * @author BeatificWang
 * @date 2019/9/2 22:35
 */
public class Configuration {

	public static ResourceBundle resourceBundle = ResourceBundle.getBundle("mybatis");

	public <T> T getMapper(Class<?> clazz, SqlSession sqlSession) {
		return (T) Proxy.newProxyInstance(
				this.getClass().getClassLoader(),
				new Class[]{clazz},
				new MapperProxy(sqlSession)
		                                 );
	}
}
